<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>元素的循环</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>

</head>
    <div id="app">
        <li v-for="i in lt">{{i}}</li>
    </div>
<body>
    <script>
        new Vue({
            el:"#app",
            data() {
                lt = []
                for(let i =0 ; i<10;i++){
                    lt[i] = i
                }
                console.log('lt is =' + lt);
                
                return {
                    lt : lt
                }
            },
            mounted() {
                console.log('挂载完元素了');
                debugger
                this.lt = this.fil
            },
            computed:{
                fil: function(){
                    return this.lt.filter(function(l){
                        return l % 2 === 0
                    });
                }
            }
        })
    </script>
</body>
</html>